X-Git-Url: http://git.cyclocoop.org/%22.%24info%5B?a=blobdiff_plain;f=maintenance%2FfixExtLinksProtocolRelative.php;h=c70b8be7c952a3eaf80141c2c313dd7d3c62164a;hb=6b3e5511fb848890f174690885e748b90389c0b8;hp=d04e0c25a54153e1f092ce2ffed36215acb22dd9;hpb=920c06e42c307fcaea47d9b65e09303aded2d1c9;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/fixExtLinksProtocolRelative.php b/maintenance/fixExtLinksProtocolRelative.php index d04e0c25a5..c70b8be7c9 100644 --- a/maintenance/fixExtLinksProtocolRelative.php +++ b/maintenance/fixExtLinksProtocolRelative.php @@ -54,8 +54,8 @@ class FixExtLinksProtocolRelative extends LoggedUpdateMaintenance { return false; } $this->output( "Fixing protocol-relative entries in the externallinks table...\n" ); - $res = $db->select( 'externallinks', array( 'el_from', 'el_to', 'el_index' ), - array( 'el_index' . $db->buildLike( '//', $db->anyString() ) ), + $res = $db->select( 'externallinks', [ 'el_from', 'el_to', 'el_index' ], + [ 'el_index' . $db->buildLike( '//', $db->anyString() ) ], __METHOD__ ); $count = 0; @@ -66,28 +66,26 @@ class FixExtLinksProtocolRelative extends LoggedUpdateMaintenance { wfWaitForSlaves(); } $db->insert( 'externallinks', - array( - array( - 'el_id' => $db->nextSequenceValue( 'externallinks_el_id_seq' ), + [ + [ 'el_from' => $row->el_from, 'el_to' => $row->el_to, 'el_index' => "http:{$row->el_index}", - ), - array( - 'el_id' => $db->nextSequenceValue( 'externallinks_el_id_seq' ), + ], + [ 'el_from' => $row->el_from, 'el_to' => $row->el_to, 'el_index' => "https:{$row->el_index}", - ) - ), __METHOD__, array( 'IGNORE' ) + ] + ], __METHOD__, [ 'IGNORE' ] ); $db->delete( 'externallinks', - array( + [ 'el_index' => $row->el_index, 'el_from' => $row->el_from, 'el_to' => $row->el_to - ), + ], __METHOD__ ); } @@ -97,5 +95,5 @@ class FixExtLinksProtocolRelative extends LoggedUpdateMaintenance { } } -$maintClass = "FixExtLinksProtocolRelative"; +$maintClass = FixExtLinksProtocolRelative::class; require_once RUN_MAINTENANCE_IF_MAIN;